home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / lib / linuxdoc-sgml / doc / example.sgml next >
SGML Document  |  1994-06-21  |  4KB

  1. <!doctype linuxdoc system>
  2.  
  3. <!-- Here's an SGML example file. Format it and print out the source, and
  4.      use it as a model for your own SGML files. As you can see this is a
  5.      comment. 
  6.  -->
  7.  
  8. <article>
  9.  
  10. <!-- Title information -->
  11.  
  12. <title>Quick SGML Example
  13. <author>Matt Welsh, <tt/mdw@cs.cornell.edu/
  14. <date>v1.0, 28 March 1994
  15. <abstract>
  16. This document is a brief example using the Linuxdoc-SGML DTD.
  17. </abstract>
  18.  
  19. <!-- Table of contents -->
  20. <toc>
  21.  
  22. <!-- Begin the document -->
  23.  
  24. <sect>Introduction
  25.  
  26. <p>
  27. This is an SGML example file using the Linuxdoc-SGML DTD. You can format it 
  28. using the command
  29. <tscreen><verb>
  30. $ format -Tnroff | qroff | pg
  31. </verb></tscreen>
  32. this will produce plain ASCII. You can also produce LaTeX, and (soon) HTML
  33. and Texinfo.
  34.  
  35. <sect>The source
  36.  
  37. <p>
  38. Looking at the source for this file will be instructive to show you how
  39. to use many of the Linuxdoc-SGML constructs. You should also read the
  40. <em/Linuxdoc-SGML User's Guide/, in the file <tt/guide.sgml/.
  41.  
  42. The source looks and feels like LaTeX, as you can see. Paragraphs are
  43. separated by blank lines, macros are enclosed in angle brackets. It's 
  44. quite simple. 
  45.  
  46. <sect>Some examples
  47.  
  48. <p>
  49. Here are examples of things that you'll be using in the source. First,
  50. let's decend into a subsection:
  51.  
  52. <sect1>This is a subsection
  53.  
  54. <p>
  55. As the header says. Note that you need to use the <tt/p/ command to
  56. start the body of the section, after the <tt/sect1/ command.
  57. Here's a subsubsection:
  58.  
  59. <sect2>This is a subsubsection
  60.  
  61. <p>
  62. Right. 5 levels of sections are available. Use the commands
  63. <tt/sect/, <tt/sect1/, <tt/sect2/, <tt/sect3/, and <tt/sect4/ to get them.
  64. This document uses the <tt>article</> document style, which is 
  65. appropriate for HOWTOs and other docs; the <tt>report</> style (which 
  66. includes the <tt/chapt/ sectioning command) should be used for the LDP docs. 
  67.  
  68. <sect1>Example text
  69.  
  70. <p>
  71. All right, so you're typing along, and you want to show some example code,
  72. or example I/O with a program, whatever. Use the <tt/code/ or <tt/verb/
  73. ``environments'' for this, wrapped in a <tt/tscreen/ environment, as so:
  74. <tscreen><verb>
  75. This is an example verb environment.
  76. </verb></tscreen>
  77. As well as:
  78. <tscreen><code>
  79. This is an example code environment.
  80. </code></tscreen>
  81. The <tt/tscreen/ environment just sets the font to small type and 
  82. indents it nicely. It's not required for using <tt/verb/ or <tt/code/,
  83. but I suggest that you do. 
  84.  
  85. The <em/Linuxdoc-SGML User's Guide/ explains what special characters you
  86. can and can't use in the <tt/verb/ and <tt/code/ environments. 
  87.  
  88. <sect1><heading><label id="test-ref">Cross references</>
  89.  
  90. <p>
  91. What about cross-references? This section has been marked with the
  92. <tt>label</> command; using <tt>ref</> will provide a cross reference,
  93. as in ``See Section <ref id="test-ref">'' for more. 
  94.  
  95. Right now cross-references don't work in the <tt/nroff/ translation for 
  96. plain ASCII.
  97.  
  98. <sect1>Using fonts
  99.  
  100. <p>
  101. You want fonts, we got fonts. Of course these won't show up in the
  102. plain ASCII text, but they all map into the various output formats:
  103. <bf/boldface/, <em/emphasis/, <sf/sans serif/, <sl/slanted/,
  104. <tt/typewriter/, and <it/italics/.
  105.  
  106. <sect1>Lists
  107.  
  108. <p>
  109. Lists are easy as well. Just use the <tt/itemize/ element with the
  110. <tt/item/ commands, seen here:
  111. <itemize>
  112. <item> This is a list.
  113. <item> Nothing exciting about that.
  114.        <itemize> 
  115.        <item> Multiple levels are supported as well.
  116.        <item> Again, that's no surprise.
  117.        </itemize>
  118.        <enum>
  119.        <item> Enumerated lists using <tt>enum</> also work.
  120.        <item> Description environments using <tt>descrip</> along
  121.           with <tt>tag</> are also available, as seen here.
  122.        </enum>
  123.        <descrip>
  124.        <tag/First item./ Here's one item.
  125.        <tag/Second item./ Here's another.
  126.        <tag/Third item./ Can we go for three?
  127.        </descrip>
  128. <item> A final item to top it all off.
  129. </itemize>
  130.  
  131. This is just about everything that you need to get started with
  132. writing SGML docs using the <tt/linuxdoc-sgml/ DTD. Please let me know
  133. if you think something should be changed or added to this document.
  134.  
  135. </article>
  136.